PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Writing a Try Statement

A Try statement is two-part compound statement. The first part, which begins with the word try , is a collection of AppleScript statements. The second part, which begins with the words on error , is an error handler--a series of statements that is executed if any of the statements in the first part causes an error message. The Try statement ends with the word end (followed optionally by error or try ).

The error handler can include up to five parameter variables (also called formal parameters ) that represent the actual information sent in the error message when the error occurs. When the error handler is called, the parameter variables become local variables in the error handler.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)